<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>037-组件-动态组件.html</title>
</head>
<body>
	<div id="app">
		<button @click="currentComponent='tab-home'">home</button>
		<button @click="currentComponent='tab-articles'">articles</button>
		<component :is="currentComponent"></component>
	</div>
	<template id="tab-home">
		<div>home</div>
	</template>
	<template id="tab-articles">
		<div>articles</div>
	</template>
</body>
<script src="js/vue.js"></script>
<script>
	Vue.component('tab-home',{
		template:'#tab-home',
	})
	Vue.component('tab-articles',{
		template:'#tab-articles',
	})
	var vm = new Vue({
		el:'#app',
		data: {
			currentComponent:'tab-home',
		},
	})
</script>
</html>